node-editor: Don't install the icon
authorMatthias Clasen <mclasen@redhat.com>
Mon, 10 Aug 2020 00:28:56 +0000 (20:28 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 10 Aug 2020 00:28:56 +0000 (20:28 -0400)
We don't want to install an icon if we're not
installing the app. Also give the artist credit.

Fixes: #3051
demos/node-editor/meson.build
demos/node-editor/node-editor-application.c
demos/node-editor/node-editor.gresource.xml

index b8513fb223ebafbb96f022621512bf5a087f02a4..4e463f20ec331ce094459417ab49aacb7276bfed 100644 (file)
@@ -20,11 +20,11 @@ executable('gtk4-node-editor',
            link_args: extra_demo_ldflags,
            install: false)
 
-# icons
-icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
+# icons, don't install them until we decide to install gtk4-node-editor
+#icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
 
-foreach size: ['scalable', 'symbolic']
-  install_subdir('data/' + size,
-    install_dir: icontheme_dir
-  )
-endforeach
+#foreach size: ['scalable', 'symbolic']
+#  install_subdir('data/' + size,
+#    install_dir: icontheme_dir
+#  )
+#endforeach
index ca5ef04e41e31733627de64256f56eb9b220d5bf..91ca2fc5ecc66839ac71c2e312ded573957b74e2 100644 (file)
@@ -60,8 +60,15 @@ activate_about (GSimpleAction *action,
   GString *s;
   GskRenderer *gsk_renderer;
   const char *renderer;
+  char *os_name;
+  char *os_version;
+  GtkWidget *dialog;
 
+  os_name = g_get_os_info (G_OS_INFO_KEY_NAME);
+  os_version = g_get_os_info (G_OS_INFO_KEY_VERSION_ID);
   s = g_string_new ("");
+  if (os_name && os_version)
+    g_string_append_printf (s, "OS\t%s %s\n\n", os_name, os_version);
 
   g_string_append (s, "System libraries\n");
   g_string_append_printf (s, "\tGLib\t%d.%d.%d\n",
@@ -93,7 +100,8 @@ activate_about (GSimpleAction *action,
                              gtk_get_minor_version (),
                              gtk_get_micro_version ());
 
-  gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
+  dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
+                         "transient-for", gtk_application_get_active_window (app),
                          "program-name", "GTK Node Editor",
                          "version", version,
                          "copyright", "© 2019—2020 The GTK Team",
@@ -105,9 +113,15 @@ activate_about (GSimpleAction *action,
                          "title", "About GTK Node Editor",
                          "system-information", s->str,
                          NULL);
+    gtk_about_dialog_add_credit_section (GTK_ABOUT_DIALOG (dialog),
+                                         "Artwork by", (const char *[]) { "Jakub Steiner", NULL });
+
+  gtk_window_present (GTK_WINDOW (dialog));
 
   g_string_free (s, TRUE);
   g_free (version);
+  g_free (os_name);
+  g_free (os_version);
 }
 
 static void
index 5cb5478ca3eaa5cb925abbb78aefc9ff4fb1288a..08464aa7662ec9d2fa3ed4659296aa309a3257f2 100644 (file)
@@ -4,5 +4,6 @@
     <file preprocess="xml-stripblanks">node-editor-window.ui</file>
     <file preprocess="xml-stripblanks">help-window.ui</file>
     <file>node-format.md</file>
+    <file alias='icons/apps/org.gtk.gtk4.NodeEditor.Devel.svg'>data/scalable/apps/org.gtk.gtk4.NodeEditor.Devel.svg</file>
   </gresource>
 </gresources>